const { app, BrowserWindow, ipcMain } = require('electron');

let mainWindow;

app.on('ready', () => {
    mainWindow = new BrowserWindow({
        width: 800,
        height: 600,
        webPreferences: {
            nodeIntegration: true,
            contextIsolation: false,
            devTools:true,
        }
    });
    mainWindow.loadFile('src/renderer/index.html');
});

ipcMain.on('process-audio', (event, { filePath, splitPoints }) => {
    // 调用 ffmpeg 分割音频
    console.log(`Processing audio: ${filePath}`);
    console.log(`Split points: ${splitPoints}`);
});